package com.example.sql.handle.impl;

import java.util.Date;

import com.example.sql.handle.ResultSetHandle;
import com.example.sql.model.RunoobTbl;

import java.sql.ResultSet;

public class RunoobTblHandle implements ResultSetHandle<RunoobTbl> {

    @Override
    public RunoobTbl handle(ResultSet resultSet) {
        RunoobTbl runoobTbl = null;
        try {
            Integer runoobId = resultSet.getInt("runoob_id");
            String runoobAuthor = resultSet.getString("runoob_author");
            String runoobTitle = resultSet.getString("runoob_title");
            Date submissionDate = resultSet.getDate("submission_date");
            runoobTbl=new RunoobTbl();
            runoobTbl.setRunoobId(resultSet.getInt("runoob_id"));
            runoobTbl.setRunoobAuthor(runoobAuthor);
            runoobTbl.setRunoobTitle(runoobTitle);
            runoobTbl.setSubmissionDate(submissionDate);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return runoobTbl;
    }

}
